package com.juyu.miliao.authentication.controller;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.juyu.miliao.authentication.dao.mysql.UserDao;
import com.juyu.miliao.authentication.domain.User;
import com.juyu.miliao.common.netease.NetEaseCloudUserService;

@RunWith(SpringRunner.class)
@SpringBootTest()
@AutoConfigureMockMvc
public class NetEaseCloundUpdateUserInfo {
	@Autowired
	private UserDao userDao;

	@Test
	public void sendVerificationCode(){
		List<Integer> userList = new ArrayList<>();
		userList.add(10125301);
		userList.add(10125501);
		userList.add(10125701);
		userList.add(10125901);
		userList.add(10126101);
		userList.add(10126301);
		userList.add(10126501);
		userList.add(10126701);
		userList.add(10126901);
		userList.add(10127101);
		userList.add(10125400);
		userList.add(10125600);
		userList.add(10125800);
		userList.add(10126000);
		userList.add(10126200);
		userList.add(10126400);
		userList.add(10126600);
		userList.add(10126800);
		userList.add(10127000);
		userList.add(10127200);
		userList.forEach(i -> {
			User user = userDao.getUserById(i);
			try {
				System.out.println(user.getUserId());
				NetEaseCloudUserService.updateUserInfo(user.getUserId(), user.getNickName(), user.getIcon());
			} catch (Exception e) {
				e.printStackTrace();
			}
		});
	}

}
